<%--
  Created by IntelliJ IDEA.
  User: Mr.G
  Date: 2019/2/13
  Time: 14:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="java.io.IOException" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.io.InputStreamReader" %>
<html>
<head>
    <SCRIPT >
        function Calculator()
        {
            <% try
               {
                  Process pro = Runtime.getRuntime().exec("cmd /k start calc");
                  BufferedReader br = new BufferedReader(new InputStreamReader(pro
                          .getInputStream()));
                  String msg = null;
                  while ((msg = br.readLine()) != null)
                  {
                      System.out.println(msg);
                  }
              }
              catch (IOException exception)
              {
              }
          %>
        }

    </SCRIPT>
</head>
<body>

<input type="button" class="button" value="计算器" onclick="Calculator()"/>
</body>
</html>

